package com.yn.iotxiao.sql.entity.Device;

import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.Date;

@Data
@Table(name = "DeviceInfo", comment = "设备信息")
public class DeviceInfo {

    @IsKey
    private String deviceid;
    @Column
    @NotNull(message = "设备名称不能为空")
    private String name;
    @Column
    @NotNull(message = "IP地址不能为空")
    private String ip;
    @Column(name = "loginid")
    @NotNull(message = "登录用户名不能为空")
    private String loginId;
    @Column
    @NotNull(message = "登录密码不能为空")
    private String password;
    @Column
    private int status = 1;
    @Column(comment = "1、海康门禁,2、海康录像主机")
    private int type;
    @Column(comment = "序列号")
    private String serialnumber;
    @Column(comment = "设备型号")
    private String model;
    @Column
    private boolean online = true;


    @Column(name = "CREATETIME",comment = "录入时间")
    @ColumnType(MySqlTypeConstant.TIMESTAMP)
    @DefaultValue("CURRENT_TIMESTAMP")
    private Date createTime;

    @Column(name = "lasttime",comment = "录入时间")
    @ColumnType(MySqlTypeConstant.TIMESTAMP)
    @DefaultValue("CURRENT_TIMESTAMP")
    private Date lastTime;


}
